Location: FieldML example - a simple mesh @ 96289c94baba / Simple Mesh FieldML 0.5.xml

Author:
Randall Britten <r.britten@auckland.ac.nz>
Date:
2012-04-26 11:04:41+12:00
Desc:
A visualisation of the simple FieldML example, created using cmgui.
Permanent Source URI:
https://models.cellml.org/w/randall/FieldML-example-simple-mesh/rawfile/96289c94baba1e2b94085fc87e2e0bda12a66a98/Simple Mesh FieldML 0.5.xml

<?xml version="1.0" encoding="UTF-8"?>
<Fieldml version="0.5"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xsi:noNamespaceSchemaLocation="http://www.fieldml.org/resources/xml/0.5/FieldML_0.5.xsd">
<Region name="mesh1">

<!-- make types and evaluators from the library visible in this region
  under local names -->
<Import xlink:href="http://www.fieldml.org/resources/xml/0.5/FieldML_Library_0.5.xml" region="library">
  <ImportType localName="real.type" remoteName="real.1d" />
  <ImportType localName="trilinearLagrange.parameters" remoteName="parameters.3d.unit.trilinearLagrange" />
  <ImportType localName="trilinearLagrange.points" remoteName="parameters.3d.unit.trilinearLagrange.component" />
  <ImportType localName="coordinates.rc.3d.component" remoteName="coordinates.rc.3d.component" />
  <ImportType localName="coordinates.rc.3d" remoteName="coordinates.rc.3d" />
  <ImportEvaluator localName="trilinearLagrange.parameters.argument" remoteName="parameters.3d.unit.trilinearLagrange.argument" />
  <ImportEvaluator localName="trilinearLagrange.points.argument" remoteName="parameters.3d.unit.trilinearLagrange.component.argument" />
  <ImportEvaluator localName="trilinearLagrange.interpolator" remoteName="interpolator.3d.unit.trilinearLagrange" />
  <ImportEvaluator localName="chart.3d.argument" remoteName="chart.3d.argument" />
  <ImportEvaluator localName="coordinates.rc.3d.component.argument" remoteName="coordinates.rc.3d.component.argument" />
  <ImportEvaluator localName="shape.unit.cube" remoteName="shape.unit.cube"/>
</Import>

<!-- define 20-member ensemble to represent nodes 1..20 -->
<EnsembleType name="mesh1.nodes">
  <Members>
    <MemberRange min="1" max="20" />
  </Members>
</EnsembleType>


<!-- declare an argument of nodes type; this represents a value source
  that other evaluators can map their values to -->
<ArgumentEvaluator name="mesh1.nodes.argument" valueType="mesh1.nodes" />

<!-- declare an argument representing the node-indexed DOFs for a field
  template, a real value expected to be a function of "mesh1.nodes.argument" -->
<ArgumentEvaluator name="mesh1.node.dofs.argument" valueType="real.type">
  <Arguments>
    <Argument name="mesh1.nodes.argument" />
  </Arguments>
</ArgumentEvaluator>

<!-- define a 3-D mesh type with 4 elements, each of unit cube shape -->
<MeshType name="mesh1.mesh.type">
  <Elements name="elements">
    <Members>
      <MemberRange min="1" max="4" />
    </Members>
  </Elements>
  <Chart name="chart">
    <Components name="mesh1.mesh.type.chart.component" count="3" />
  </Chart>
  <Shapes evaluator="shape.unit.cube"/>
</MeshType>

<!-- declare an argument of the mesh type. Evaluators varying only with this
  argument are interpreted as fields over the mesh -->
<ArgumentEvaluator name="mesh1.mesh.argument" valueType="mesh1.mesh.type" />

<!-- An inline data resource listing 8 corner nodes per element. Resources
  are just raw data; a ParameterEvaluator is needed to add semantic meaning -->
<DataResource name="mesh1.nodes.connectivity.resource">
  <DataResourceDescription>
    <DataResourceString>
        1	2	3	4	5	6	7	8
        5	6	7	8	9	10	11	12
        9	10	11	12	13	14	15	16
        13	14	15	16	17	18	19	20
    </DataResourceString>
  </DataResourceDescription>
  <ArrayDataSource name="mesh1.nodes.connectivity.data" location="1" rank="2">
    <RawArraySize>
      4 8
    </RawArraySize>
  </ArrayDataSource>
</DataResource>

<!-- define mapping from element × localnode to global index from ensemble
  "mesh1.nodes.argument". "trilinearLagrange.points" are documented
  as being the 8 corner points of a unit cube at chart locations:
  (0,0,0), (1,0,0), (0,1,0), (1,1,0), (0,0,1), (1,0,1), (0,1,1), (1,1,1) -->
<ParameterEvaluator name="mesh1.trilinearLagrange.connectivity" valueType="mesh1.nodes">
  <DenseArrayData data="mesh1.nodes.connectivity.data">
    <DenseIndexes>
      <IndexEvaluator evaluator="mesh1.mesh.argument.elements" /><!-- Needs improvement: mesh1.mesh.arguments is an alias to mesh1.mesh.type which has an elements factor so this is a way of referring to that factor, using contents of the string. -->
      <IndexEvaluator evaluator="trilinearLagrange.points.argument" />
    </DenseIndexes>
  </DenseArrayData>
</ParameterEvaluator>

<!-- construct a vector of node parameters to pass on to
  "mesh1.trilinear.interpolator" -->
<AggregateEvaluator name="mesh1.trilinearLagrange.parameters"
    valueType="trilinearLagrange.parameters">
  <Bindings>
    <BindIndex argument="trilinearLagrange.points.argument" indexNumber="1" />
    <Bind argument="mesh1.nodes.argument" source="mesh1.trilinearLagrange.connectivity" />
  </Bindings>
  <ComponentEvaluators default="mesh1.node.dofs.argument" />
</AggregateEvaluator>

<!-- define evaluator returning value of library trilinear Lagrange interpolator
  at the element chart location of mesh type "mesh1.mesh" and using parameters
  from evaluator "mesh1.trilinearLagrange.parameters". -->
<ReferenceEvaluator name="mesh1.trilinear.interpolator"
    evaluator="trilinearLagrange.interpolator" valueType="real.type">
  <Bindings>
    <Bind argument="chart.3d.argument" source="mesh1.mesh.argument.chart" />
    <Bind argument="trilinearLagrange.parameters.argument" source="mesh1.trilinearLagrange.parameters" />
  </Bindings>
</ReferenceEvaluator>

<!-- define a piecewise template delegating which evaluator gives the template
  its values in each element, which is trivial for this one element mesh.
  It is a template for a field defined over the mesh represented by
  "mesh1.mesh.argument", with the unbound parameter source
  "mesh1.node.dofs.argument" inherited from delegate evaluator
  "cube.trilinear.interpolator" -->
<PiecewiseEvaluator name="mesh1.template.trilinear" valueType="real.type">
  <IndexEvaluators>
    <IndexEvaluator evaluator="mesh1.mesh.argument.elements" indexNumber="1" />
  </IndexEvaluators>
  <EvaluatorMap default="mesh1.trilinear.interpolator" />
</PiecewiseEvaluator>

<!-- inline data resource listing raw values for the 8 nodes * 3 components
  of the 'coordinates' field. ParameterEvaluator "mesh1.node.coordinates"
  gives the data semantic meaning. -->
<DataResource name="mesh1.coordinates.resource">
  <DataResourceDescription>
    <DataResourceString>
      0.0 0.0 0.0
      1.0 0.0 0.0
      0.0 1.0 0.0
      1.0 1.0 0.0
      0.0 0.0 1.0
      1.0 0.0 1.0
      0.0 1.0 1.0
      1.0 1.0 1.0
      0.0 0.0 2.0
      1.0 0.0 2.0
      0.0 1.0 2.0
      1.0 1.0 2.0
      0.0 0.0 3.0
      1.0 0.0 3.0
      0.0 1.0 3.0
      1.0 1.0 3.0
      0.0 0.0 4.0
      1.0 0.0 4.0
      0.0 1.0 4.0
      1.0 1.0 4.0
    </DataResourceString>
  </DataResourceDescription>
  <ArrayDataSource name="mesh1.coordinates.data" location="1" rank="2">
    <RawArraySize>
      20 3
    </RawArraySize>
  </ArrayDataSource>
</DataResource>

<!-- parameters for the coordinate field, listing a scalar real parameter
  for all permutations of library 3-component ensemble
  "coordinates.rc.3d.component" and 8-member ensemble "mesh1.nodes.argument" -->
<ParameterEvaluator name="mesh1.node.coordinates" valueType="real.type">
  <DenseArrayData data="mesh1.coordinates.data">
    <DenseIndexes>
      <IndexEvaluator evaluator="mesh1.nodes.argument" />
      <IndexEvaluator evaluator="coordinates.rc.3d.component.argument" />
    </DenseIndexes>
  </DenseArrayData>
</ParameterEvaluator>

<!-- define the final vector coordinates field by aggregating evaluators for
  each component of the vector valueType. Although each component uses the
  same evaluator in this example, they produce different values because the
  parameters on which they depend vary with the same component ensemble
  argument ("coordinates.rc.3d.component.argument"). -->
<AggregateEvaluator name="coordinates" valueType="coordinates.rc.3d">
  <Bindings>
    <BindIndex argument="coordinates.rc.3d.component.argument" indexNumber="1" />
    <Bind argument="mesh1.node.dofs.argument" source="mesh1.node.coordinates" />
  </Bindings>
  <ComponentEvaluators default="mesh1.template.trilinear" />
</AggregateEvaluator>

<!-- inline data resource listing pressure values for the 20 nodes. -->
<DataResource name="mesh1.pressure.resource">
  <DataResourceDescription>
    <DataResourceString>
       80000.0
      100000.0
      100000.0
       80000.0
      100000.0
       80000.0
       80000.0
      100000.0
       70000.0
      110000.0
      100000.0
       70000.0
      120000.0
       80000.0
       80000.0
       90000.0
       90000.0
      100000.0
      100000.0
       90000.0
    </DataResourceString>
  </DataResourceDescription>
  <ArrayDataSource name="mesh1.pressure.data" location="1" rank="1">
    <RawArraySize>
      20
    </RawArraySize>
  </ArrayDataSource>
</DataResource>

<!-- parameters for the pressure field, listing a scalar real parameter
  for each member of "mesh1.nodes.argument" -->
<ParameterEvaluator name="mesh1.node.pressure" valueType="real.type">
  <DenseArrayData data="mesh1.pressure.data">
    <DenseIndexes>
      <IndexEvaluator evaluator="mesh1.nodes.argument" />
    </DenseIndexes>
  </DenseArrayData>
</ParameterEvaluator>

<!-- define a scalar 'pressure' field using the same template as
  components of coordinates field -->
<ReferenceEvaluator name="pressure" evaluator="mesh1.template.trilinear" valueType="real.type">
  <Bindings>
    <Bind argument="mesh1.node.dofs.argument" source="mesh1.node.pressure" />
  </Bindings>
</ReferenceEvaluator>

</Region>
</Fieldml>